import request from "@/utils/request";

export async function userlist(params) {
  const res = await request({
    url: "/Users/userlist",
    method: "post",
    params,
  });
  return res;
}
// 修改用户状态
export async function setuserstate(params) {
  const res = await request({
    url: "/Users/setuserstate",
    method: "post",
    params,
  });
  return res;
}
// 修改会员等级
export async function setULevel(params) {
  const res = await request({
    url: "/Users/setULevel",
    method: "post",
    params,
  });
  return res;
}
// 修改服务商身份
export async function setDls(params) {
  const res = await request({
    url: "/Users/setDls",
    method: "post",
    params,
  });
  return res;
}
// 修改用户角色
export async function SetStoreManager(params) {
  const res = await request({
    url: "/Users/SetStoreManager",
    method: "post",
    params,
  });
  return res;
}

// 修改用户标签
export async function SetUTag(params) {
  const res = await request({
    url: "/Users/SetUTag",
    method: "post",
    params,
  });
  return res;
}

// 修改用户邀请人
export async function SetUserInv(params) {
  const res = await request({
    url: "/Users/ChangeInvuser",
    method: "post",
    params,
  });
  return res;
}

// 修改用户是否节点
export async function setUserisjd(params) {
  const res = await request({
    url: "/Users/setUserisjd",
    method: "post",
    params,
  });
  return res;
}

// 设置用户提现、转账开关
export async function SetCloseState(params) {
  const res = await request({
    url: "/Users/SetCloseState",
    method: "post",
    params,
  });
  return res;
}

// 用户等级统计
export async function UserLevelTotal(params) {
  const res = await request({
    url: "/Users/UserLevelTotal",
    method: "post",
    params,
  });
  return res;
}

// 节点等级统计
export async function UserLevelTotal_node(params) {
  const res = await request({
    url: "/Users/UserLevelTotal_node",
    method: "post",
    params,
  });
  return res;
}

// 按等级查询节点用户
export async function userLower_node(params) {
  const res = await request({
    url: "/Users/userLower_node",
    method: "post",
    params,
  });
  return res;
}

// 按等级查询伞下用户
export async function userLower(params) {
  const res = await request({
    url: "/Users/userLower",
    method: "post",
    params,
  });
  return res;
}

// 用户列表 导出Excel
export async function userlistExcel(params) {
  const res = await request({
    url: "/Users/userlistExcel",
    method: "post",
    params,
    responseType: "blob",
  });
  return res;
}

// 用户奖励
export async function creditPage(params) {
  const res = await request({
    url: "/Users/creditPage",
    method: "post",
    params,
  });
  return res;
}

// 用户业绩奖励汇总
export async function teamtotal(params) {
  const res = await request({
    url: "/Users/teamtotal",
    method: "post",
    params,
  });
  return res;
}

// 用户排点查询
export async function userorder(params) {
  const res = await request({
    url: "/Users/userorder",
    method: "post",
    params,
  });
  return res;
}

// 订单类型列表
export async function userordertype(params) {
  const res = await request({
    url: "/Users/userordertype",
    method: "post",
    params,
  });
  return res;
}

// 订单类型设置
export async function userOrderTypeEdit(data) {
  const res = await request({
    url: "/Users/userOrderTypeEdit",
    method: "post",
    data,
  });
  return res;
}

// 用户矿机记录
export async function GetuserminerPage(params) {
  const res = await request({
    url: "/Users/GetuserminerPage",
    method: "post",
    params,
  });
  return res;
}
// 修改其他等级
export async function setlevel1(params) {
  const res = await request({
    url: "/Users/setlevel1",
    method: "post",
    params,
  });
  return res;
}

// 设置 直开POS矿池
export async function Setallowpos(params) {
  const res = await request({
    url: "/Users/Setallowpos",
    method: "post",
    params,
  });
  return res;
}

export async function getteam(params) {
  const res = await request({
    url: "/Users/getteam",
    method: "post",
    params,
  });
  return res;
}

export async function user_resetpwd(data) {
  const res = await request({
    url: "/Users/user_resetpwd",
    method: "post",
    data,
  });
  return res;
}
// 余额列表
export async function userbalance(params) {
  const res = await request({
    url: "/Users/userbalance",
    method: "post",
    params,
  });
  return res;
}

// 用户余额列表 导出Excel
export async function userbalanceExcel(params) {
  const res = await request({
    url: "/Users/userbalanceExcel",
    method: "post",
    params,
    responseType: "blob",
  });
  return res;
}

// 系统充值、扣款
export async function AddBalance(params) {
  const res = await request({
    url: "/Users/AddBalance",
    method: "post",
    params,
  });
  return res;
}

// 线下充值列表
export async function Getutb(params) {
  const res = await request({
    url: "/Users/Getutb",
    method: "post",
    params,
  });
  return res;
}

// 线下充值审核
export async function Examine(params, data) {
  const res = await request({
    url: "/Users/Examine",
    method: "post",
    params,
    data,
  });
  return res;
}

// 资金记录流水
export async function userbalancerecord(params) {
  const res = await request({
    url: "/Users/userbalancerecord",
    method: "post",
    params,
  });
  if (res.list.length > 0) {
    res.list.forEach((item) => {
      // item.ctime = item.ctime.replace('T', ' ').substr(0, 16)
      // item.otime = item.otime.replace('T', ' ').substr(0, 16)
    });
  }
  return res;
}

// 资金记录列表 生成打款订单
export async function CreateWithdrawApply(params) {
  const res = await request({
    url: "/Users/CreateWithdrawApply",
    method: "post",
    params,
  });
  return res;
}
// 资金记录列表 导出Excel
export async function UserBalanceRecordExcel(params) {
  const res = await request({
    url: "/Users/UserBalanceRecordExcel",
    method: "post",
    params,
    responseType: "blob",
  });
  return res;
}

// 用户收入统计列表
export async function UserBalanceRecordIncomeTotal(params) {
  const res = await request({
    url: "/Users/UserBalanceRecordIncomeTotal",
    method: "post",
    params,
  });
  return res;
}

// 用户收入统计列表 导出Excel
export async function UserBalanceRecordIncomeTotalExcel(params) {
  const res = await request({
    url: "/Users/UserBalanceRecordIncomeTotalExcel",
    method: "post",
    params,
    responseType: "blob",
  });
  return res;
}

// 提现审核列表
export async function tradetransactionout(params) {
  const res = await request({
    url: "/Users/tradetransactionout",
    method: "post",
    params,
  });
  return res;
}

// 审核
export async function setoutstate(params) {
  const res = await request({
    url: "/Users/setoutstate",
    method: "post",
    params,
  });
  return res;
}

// 交易类型
export async function gettradetyep() {
  const res = await request({
    url: "/Users/gettradetyep",
    method: "post",
  });
  return res;
}

// 用户伞下业绩
export async function GetUserTeam(params) {
  const res = await request({
    url: "/Users/GetUserTeam",
    method: "post",
    params,
  });
  return res;
}

// 用户网体业绩
export async function userNode(params) {
  const res = await request({
    url: "/Users/userNode",
    method: "post",
    params,
  });
  return res;
}

// 兑换记录
export async function exchangeRecord(params) {
  const res = await request({
    url: "/Users/exchangeRecord",
    method: "post",
    params,
  });
  return res;
}

// 充值充币记录
export async function rechargePage(params) {
  const res = await request({
    url: "/Users/rechargePage",
    method: "post",
    params,
  });
  return res;
}

// 提现提币记录
export async function takoutPage(params) {
  const res = await request({
    url: "/Users/takoutPage",
    method: "post",
    params,
  });
  return res;
}

// 转账记录
export async function transferPage(params) {
  const res = await request({
    url: "/Users/transferPage",
    method: "post",
    params,
  });
  return res;
}

// 提币审核
export async function takoutState(params) {
  const res = await request({
    url: "/Users/takoutState",
    method: "post",
    params,
  });
  return res;
}

// 第一生态业绩列表
export async function userteamtotal(params) {
  const res = await request({
    url: "/Users/userteamtotal",
    method: "post",
    params,
  });
  return res;
}

//第一生态 用户等级
export async function setUserLevel_1(params) {
  const res = await request({
    url: "/Users/setUserLevel_1",
    method: "post",
    params,
  });
  return res;
}

// 第二生态业绩列表
export async function userwodteamtotal(params) {
  const res = await request({
    url: "/Users/userwodteamtotal",
    method: "post",
    params,
  });
  return res;
}

//第二生态 用户等级
export async function setUserLevel_2(params) {
  const res = await request({
    url: "/Users/setUserLevel_2",
    method: "post",
    params,
  });
  return res;
}
//新增用户
export async function Register(params) {
  const res = await request({
    url: "/Users/Register",
    method: "post",
    params,
  });
  return res;
}

//修改用户信息
export async function SetUserInfo(params) {
  const res = await request({
    url: "/Users/SetUserInfo",
    method: "post",
    params,
  });
  return res;
}

//修改用户收款信息
export async function SetBankInfo(params) {
  const res = await request({
    url: "/Users/SetBankInfo",
    method: "post",
    params,
  });
  return res;
}
//算力增减
export async function editPower(params) {
  const res = await request({
    url: "/Users/editPower",
    method: "post",
    params,
  });
  return res;
}

// 用户充值日统计
export async function DayRechargePage(params) {
  const res = await request({
    url: "/Finance/DayRechargePage",
    method: "post",
    params,
  });
  return res;
}

// 用户提现日统计
export async function DayWithdrawPage(params) {
  const res = await request({
    url: "/Finance/DayWithdrawPage",
    method: "post",
    params,
  });
  return res;
}

// 用户充值明细
export async function RechargePage(params) {
  const res = await request({
    url: "/Finance/RechargePage",
    method: "post",
    params,
  });
  return res;
}

// 用户提现明细
export async function WithdrawPage(params) {
  const res = await request({
    url: "/Finance/WithdrawPage",
    method: "post",
    params,
  });
  return res;
}

// 用户收益日统计
export async function creditDay(params) {
  const res = await request({
    url: "/Finance/creditDay",
    method: "post",
    params,
  });
  return res;
}

// 用户收益明细
export async function creditDetail(params) {
  const res = await request({
    url: "/Finance/creditDetail",
    method: "post",
    params,
  });
  return res;
}

// 首页统计数据
export async function GetHomeIndex(params) {
  const res = await request({
    url: "/Finance/GetHomeIndex",
    method: "post",
    params,
  });
  return res;
}

// 总收益日统计
export async function totoalcreditDay(params) {
  const res = await request({
    url: "/Finance/totoalcreditDay",
    method: "post",
    params,
  });
  return res;
}
